package com.wswy.wzcx.module;

public final class ScTimes {

  //记录应用信息

  private static volatile long sAppStart=0;
  private static volatile long sAdShowTime=0;
  private static volatile long sLoginCount = 0;
  private static volatile long sLogoutCount = 0;

  //发送成功
  private static volatile long sSendSMSCount = 0;
  private static volatile long sLastSendTime = 0;
  //发送失败
  private static volatile long sSendSMSFailCount = 0;
  private static volatile long sLastSendFailTime = 0;

  private static volatile long sLoginPageCount = 0;


  private static volatile long sLastStartLoginPageTime = 0;

  //app启动时间
  public static void appStart(){
    sAppStart = System.currentTimeMillis();
  }

  //广告显示时间
  public static void adShowTime(){
    sAdShowTime = System.currentTimeMillis();
  }

  //登录次数
  public static void addLogin(){
    sLoginCount++;
  }

  //退出次数
  public static void addLogout(){
    sLogoutCount++;
  }

  //发送短信次数
  public static void addSendSms(boolean success){

    if (success){
      sSendSMSCount++;
      //最后发送时间
      sLastSendTime = System.currentTimeMillis();
    }else {
      sSendSMSFailCount++;
      sLastSendFailTime = System.currentTimeMillis();
    }

  }


  //打开登录页面
  public static void startLoginPage(){
    sLoginPageCount++;

    //最后打开登录页时间
    sLastStartLoginPageTime = System.currentTimeMillis();
  }


  public static long getSendSMSCount(){
    return sSendSMSCount + sSendSMSFailCount;
  }

  public static long getLastSendTime(){
    return Math.max(sLastSendTime,sLastSendFailTime);
  }


  public static String getTimeStr(){
    return "";
  }

}
